import TemplateHelper from "../template/templatehelper";
//import FileHelper from "../system/filehelper";

function types(params) {
  console.log(params);
  return TemplateHelper.getTypes();
}

function templates(params) {
  //console.log("templates(params)");
  //console.log(params);
  let linkId = params.linkId;
  let tableId = params.tableId;
  let type = params.type;

  return TemplateHelper.getTemplates(linkId, tableId, type);
}

function code(params) {
  //console.log("templates(params)");
  //console.log(params);
  let linkId = params.linkId;
  let tableId = params.tableId;
  let type = params.type;
  let templateId = params.templateId;

  return TemplateHelper.previewCode(linkId, tableId, type, templateId);
}

function json(params) {
  //console.log("templates(params)");
  //console.log(params);
  let linkId = params.linkId;
  let tableId = params.tableId;
  let type = params.type;
  let templateId = params.templateId;

  return TemplateHelper.previewJson(linkId, tableId, type, templateId);
}

function produce(params) {
  console.log("produce(params)");
  console.log(params);
  let linkId = params.linkId;
  let tableIds = params.tableIds;
  let type = params.type;

  return TemplateHelper.produceFiles(linkId, tableIds, type);
}

export default { types, templates, code, json, produce };
